package com.changgou.seckill.config;

import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbitMqConfig {

    //秒杀商品订单消息
    public static final String SECKILL_ORDER_QUEUE = "seckill_order";

    //秒杀商品队列
    @Bean(SECKILL_ORDER_QUEUE)
    public Queue queue() {
        //开启队列持久化
        return new Queue(SECKILL_ORDER_QUEUE, true);
    }
}
